{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "https://leetcode.com/problems/duplicate-zeros\n",
    "\n",
    "\n",
    "\n",
    "Runtime: 72 ms, faster than 42.52% of Python3 online submissions for Duplicate Zeros.\n",
    "Memory Usage: 14.7 MB, less than 36.54% of Python3 online submissions for Duplicate Zeros.\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "```python\n",
    "class Solution:\n",
    "    def duplicateZeros(self, arr: List[int]) -> None:\n",
    "        \"\"\"\n",
    "        Do not return anything, modify arr in-place instead.\n",
    "        \"\"\"\n",
    "        length = len(arr)\n",
    "        i = 0\n",
    "        while i < len(arr):\n",
    "            v = arr[i]\n",
    "            if v == 0:\n",
    "                arr.insert(i, 0)\n",
    "                i += 1\n",
    "            i += 1\n",
    "        while len(arr) > length:\n",
    "            arr.pop()\n",
    "```\n",
    "\n",
    "spent 20 minutes\n",
    "\n",
    "failed 5 times"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
